package cn.itcast.controller;

import cn.itcast.pojo.User;
import cn.itcast.service.UserService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: inexorable
 * @date: 2019/7/27 20:49
 * @VERSION V1.0
 * @description
 */
@RestController
@RequestMapping("user")
public class UserMapper {
    @Reference
    private UserService userService;

    /**
     * 通过用户名和密码登录页面
     * @param username
     * @return
     */
    @RequestMapping("login")
    public User login(@RequestParam("username") String username ) {
        return userService.findUserByUsernameAndPwd(username);

    }
}
